﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>蓝领</title>
<!---------------------------------- 页面基本设置禁止随意更改 ------------------------------------------>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="index" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="renderer" content="webkit" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!---------------------------------- 页面基本设置禁止随意更改 -------------------------------------------->
<!---------------------------------- 基础CSS类库可随意更改 ---------------------------------------------->
<link type="text/css" rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/reset.css" />
<link type="text/css" rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/bl-job.css" />
<!---------------------------------- 基础CSS类库可随意更改结束 -------------------------------------------->
<!---------------------------------- 基础js类库可随意更改 ---------------------------------------->
<script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.1.min.js?v={yun:}$config.cachecode{/yun}"></script>
<!---------------------------------- 基础js类库可随意更改 ---------------------------------------->
<!---------------------------------- 插件js类库不可随意更改 ---------------------------------------->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=g6i5EtiSZidSCvq9hj5YG75VvYrhBdil"></script>
<!---------------------------------- 插件js类库不可随意更改 ---------------------------------------->
    <script>var weburl = '{yun:}url m=wap{/yun}';</script>
<style>
.mapwaybox{
	width:100%;
	height:100%;
	padding-top:46px;
	}
.mapway{
	width:100%;
	height:100%;
	}
.mapway #l-map{
	height:300px;width:100%;
	}
.mapway  #r-result, .mapway #r-result table{width:100%;}

.waytab_h{
	position:absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #cecece;
    z-index: 200;
	}
.waytab_h ul {
    font-size: 0;
    margin: 0;
    padding: 0;
}
.waytab_h li {
    height: 46px;
    line-height: 44px;
    display: inline-block;
    width: 25%;
    text-align: center;
    position: relative;
}
.waytab_h li .name {
    font-size: 16px;
    color: #333333;
}
.waytab_h li .line {
    width: 50%;
    height: 3px;
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translate(-50%);
    background-color: #fff;
}
.waytab_h li.active .name {
    color: #418af1;
}
.waytab_h li.active .line {
    background-color: #418af1;
}

	
</style>

</head>
<body>
<div class="mapwaybox">
    <div class="waytab_h">
       <ul>
        <li><a href="{yun:}url m=wap c=job a=jobmap id=$com.id type=bus{/yun}"><span class="name">公交</span><span class="line"></span></a></li>
        <li   class="active"><a href="{yun:}url m=wap c=job a=jobmap id=$com.id type=car{/yun}"><span class="name">驾车</span><span class="line"></span></a></li>
        <li><a href="{yun:}url m=wap c=job a=jobmap id=$com.id type=footer{/yun}"><span class="name">步行</span><span class="line"></span></a></li>
        <li><a href="{yun:}url m=wap c=job a=jobmap id=$com.id type=ride{/yun}"><span class="name">骑行</span><span class="line"></span></a></li>
      </ul>
    </div>   
    <div class="mapway">
    	<div id="l-map"></div>
        <div id="result"></div>
    </div>
</div>

<!--地图配置开始-->
<script>
    function getmapway(){
		// 百度地图API功能
        var x='{yun:}$com.x{/yun}';
        var y='{yun:}$com.y{/yun}';
		var point = new BMap.Point(x, y);
		
		//地图初始化
		var map = new BMap.Map("l-map");
		map.centerAndZoom(point, 11);
		map.enableScrollWheelZoom(true); 
		
        //获取当前地点
		var mkpoint;
		var geolocation = new BMap.Geolocation();
		// 开启SDK辅助定位
		geolocation.enableSDKLocation();
		geolocation.getCurrentPosition(function(r){
			if(this.getStatus() == BMAP_STATUS_SUCCESS){
				mypoint = new BMap.Point(r.point.lng,r.point.lat);
				 //驾车				
				 var driving = new BMap.DrivingRoute(map, {renderOptions: {map: map, panel: "result" ,autoViewport: true}});
	             driving.search(mypoint, point);
	
				}
			/*else {
				alert('failed'+this.getStatus());
			} */ 
			else {
                    if(this.getStatus() == "6") {
                        layermsg("开启手机定位后才能使用此功能", 2);
                        return false;
                    } else if(this.getStatus() == "7") {
                        layermsg("开启手机定位后才能使用此功能", 2);
                        return false;
                    } else {
                        layermsg("地图定位出错", 2);
                        return false;
                    }
                }      
		    },{enableHighAccuracy: true});
				
		
		
		
		
		}	         
	$(function(){
		getmapway();
		})
</script>


<!--地图配置结束-->
</body>
</html>
